import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    phones: []
  },
  getters: {},
  mutations: {
    addPhone(state, phone) {
      state.phones.push(phone);
    },
    removePhone(state, phone) {
      const phoneIndex = state.phones.findIndex(ele => ele === phone);
      state.phones.splice(phoneIndex, 1);
    }
  },
  actions: {},
  modules: {}
})